NEW YORK - Wall Street capped a week of big gains with modest moves yesterday as investors grappled with surging energy prices that overshadowed news of a surprise increase in home construction.

Before the market opened, the Commerce Department reported that home construction had soared 8.2 percent in April.

But investors were clearly sidetracked for much of the session by energy prices and their effect on consumer spending, which accounts for more than two-thirds of U.S. economic activity. The price of a barrel of oil spiked to $127.82, setting a new intraday trading record.

The market's concerns about consumers appeared well-founded: The Reuters/University of Michigan consumer-sentiment reading fell to 59.5 in May - the lowest mark since June 1980.

Despite the uneasiness over energy prices, stocks posted strong gains for the week. The broader market, as measured by the Standard & Poor's 500 index, rose 2.7 percent for the week. Yesterday, the S&P 500 index ticked up 1.78, or 0.13 percent, to 1,425.35.

The Dow Jones industrial average slipped 5.86, or 0.05 percent, yesterday, closing at 12,986.80. For the week, the Dow rose 1.89 percent.

The Nasdaq composite index fell 4.88, or 0.19 percent, to 2,528.85 yesterday, but still rose 3.41 percent for the week. The S&P 500 and Nasdaq remain at five-month highs.

The Russell 2000 index of smaller companies fell 2.21 yesterday, or 0.30 percent, to 741.17.

Gold prices rose, while the dollar fell against other major currencies.

Light, sweet crude rose $2.17 to settle at a record close of $126.29 per barrel before the start of the summer driving season and after supply disruptions in China. Oil held to gains even after Saudi Arabia's oil minister said the country had boosted production 300,000 barrels a day last week in response to requests from customers. The Energy Department said it would stop adding to the nation's Strategic Petroleum Reserve for six months starting July 1.

David Kelly, chief market strategist at JPMorgan Funds, said that investors likely would continue to worry about oil prices, but that there was a sense that if the economy were in a recession, it likely would prove to be a mild one. He said stocks had been able to advance from their mid-March lows because fears of worsening troubles in the credit market had receded somewhat.

"I think oil is still the worrying wild card in all of this, but the central theme of this year is that we are gradually moving from the credit storm to the economic storm. At this stage, the economic storm is essentially getting downgraded from a hurricane to a nor'easter," he said.

Kelly said that government economic-stimulus checks should help consumers absorb increased energy prices, and that the rebates were leaving consumers with extra money despite higher gasoline costs.