By Sinead Carew

NEW YORK (Reuters) – The S&P 500 index closed at a record high on Friday, as energy shares gained with oil prices, while the Nasdaq composite index (.IXIC) hit a 15-year high helped by technology stocks.

Equities rallied this week after a ceasefire agreement between Ukraine and Russia and apparent progress toward a deal on Greek debt.

The Nasdaq had the strongest gains of the three main indexes on Friday. A strong report by Cisco Systems Inc (CSCO.O) earlier in the week led some investors to conclude that technology demand is improving, said Peter Jankovskis, co-chief investment officer at OakBrook Investments LLC in Lisle, Illinois.

“It’s possible there’s a sentiment that technology is turning the corner,” he said.

The market gained momentum late in the session after many traders had held off on making big bets earlier in the last trading day before a long weekend. U.S. markets are closed on Monday for the Presidents Day holiday.

The Dow Jones industrial average (.DJI) rose 46.97 points, or 0.26 percent, to 18,019.35, the S&P 500 (.SPX) gained 8.51 points, or 0.41 percent, to 2,096.99, a record high. The Nasdaq Composite (.IXIC) added 36.22 points, or 0.75 percent, to 4,893.84.

The Russell 2000 (.RUT) index of small-cap shares also finished at a record high.

For the week, the Dow rose 1.1 percent, the S&P 500 gained 2 percent and the Nasdaq added 3.2 percent.

The S&P energy sector (.SPNY) closed up 1.95 percent as oil topped $ 60 for the first time in 2015 despite persistent worries about oversupply.

In contrast, the S&P utilities sector (.SPLRCU) was the worst performer, falling 1.6 percent, closing down for the third day in a row. Many investors are leaving safe-haven utilities stocks as they anticipate U.S. Federal Reserve interest rate increases later this year.

American Express (AXP.N) weighed on the S&P index with a 3 percent decline. Several brokerages slashed price targets for the company after Costco (COST.O) said it would stop accepting its card in its U.S. stores.

Of the 391 S&P 500 companies that have reported earnings, about 71.1 percent have topped profit expectations, according to Thomson Reuters data, while 57.5 percent have beaten on revenue.

The earnings growth rate for the quarter is 6.6 percent, down from the 11.2 percent expected on Oct. 1, but up from 4.2 percent expected on Jan. 1.

U.S. import prices tumbled 2.8 percent in January, the largest decline since December 2008 and the seventh straight month of declines, indicating inflation pressures could remain subdued, while consumer sentiment fell from an 11-year high.

About 6.5 billion shares changed hands on U.S. exchanges, below the 7.3 billion average so far this month, according to BATS Global Markets.

NYSE advancers outnumbered decliners 1,919 to 1,146, for a 1.67-to-1 ratio; on the Nasdaq, 1,726 issues rose and 983 fell, a 1.76-to-1 ratio.

The S&P 500 posted 76 new 52-week highs and 1 new low; the Nasdaq Composite recorded 111 new highs and 29 lows.

(Additional reporting by Caroline Valetkevitch; Editing by Bernadette Baum and Nick Zieminski)