Stocks ended slightly higher Wednesday as the Federal Reserve's Beige Book sparked gains late in the session, partly offsetting a spike in oil prices that had kept the major indexes lower for most of the day.

The Dow Jones industrial average (search) gained 18.80 points, or 0.18 percent, to end at 10,566.37, marking a reversal from its fall to a session low at 10,495.39. The Standard & Poor's 500 Index (search) advanced 2.67 points, or 0.22 percent, to close at 1,206.58. The technology-laced Nasdaq Composite Index (search) rose 5.88 points, or 0.28 percent, to finish at 2,074.92.

The market had been broadly lower until the Fed's Beige Book (search) release at 2 p.m. EDT, which prompted the Dow and the S&P 500 to cut most of their earlier losses.

"The Beige Book said prices on a retail level were well contained and that producers are having trouble passing on price increases," said Todd Clark, head of equity trading at Wells Fargo Securities. "If that's true, inflation appears to be contained."

Indeed, the Beige Book — an anecdotal report of economic conditions in the 12 Federal Reserve Bank (search) districts — said U.S. business activity continued to expand from mid-April through May, and overall price pressures were moderate although some regions reported rising costs for fuel and building materials. Some districts said manufacturers were unable to pass along rising costs of their raw materials because of long-term contracts or foreign competition.

Meanwhile, oil prices rose to two-month highs after the federal government reported a decline in U.S. crude oil stockpiles by a higher-than-expected 1.8 million barrels. U.S. light sweet crude for July delivery rose 57 cents to settle at $55.57 a barrel on the New York Mercantile Exchange (search) — within $3 of the record hit in early April.

Crude prices, which had risen above $56 a barrel, eased late in the session, taking some pressure off the market. Rising oil prices usually spark concerns that higher energy costs will pinch corporate profits and curb consumer spending.

Some blue-chip industrial stocks, like United Technologies Corp. (UTX), were driven lower by the jump in oil prices. United Technologies shares fell 1.1 percent, or 58 cents, to $52.36.

Among the energy companies whose stocks rose along with oil prices were ConocoPhillips (COP), up 1.4 percent,, or 78 cents, at $57.33, and Chevron Corp. (CVX), up 1.3 percent, or 71 cents, at $56.84. Both stocks helped propel the S&P 500 up to a slight gain for the day, from an earlier loss. During the session, ConocoPhillips hit a fresh 52-week high at $57.42.

The surprise decline in domestic crude supplies overshadowed a 0.1 percent drop in the government's consumer price index. It was the first decline in 10 months for the index, which encouraged investors.

With market watchers worried about interest rates and inflation still a primary concern of the Federal Reserve, the improved CPI raised hopes that the central bank will be less aggressive with its rate policy.

Conventional wisdom is that Fed policy makers will raise rates for the ninth time when they meet at the end of the month, but investors are split on when the rate hikes, which began a year ago, will end.

Oscar Gonzalez, an economist at John Hancock Financial Services, blamed valuations for 2005's lackluster performance, saying stocks ended last year at such high prices, the more recent good news hasn't helped.

"If you look at the market from the beginning of the year, we are almost treading water at this point," he said. "Maybe investors were hoping that economic data, financial data and profits were going to be even better than what we've seen so far."

Bonds sold off for the second straight session, with the yield on the 10-year Treasury note rising to 4.13 percent from 4.11 percent late Tuesday. The U.S. dollar was mixed against other major currencies; the euro was quoted at $1.2045, down from $1.2047 late Tuesday in New York. Gold prices also were mixed.

Shares of aircraft and defense company Boeing Co. (BA) rose 2.4 percent to $64.41, helping to lift the Dow after the company said it received an order worth $1.2 billion from Spain's Air Europa.

Dow component JPMorgan Chase & Co. (JPM) rose 7 cents to $35.67 after it said it would pay $2.2 billion to settle lawsuits over its handling of Enron Corp.'s fraudulent finances. Like other Wall Street firms, JPMorgan Chase was accused of allowing Enron to continue raising money through stock and bond sales despite its downward spiral.

Wall Street firm Bear Stearns Cos. Inc. (BSC) said its income rose 5 percent from a year ago, based on strength in its institutional stock trading business. Its results beat analysts' estimates by 22 cents a share. Bear Stearns gained 79 cents to $101.12.

Viacom Inc. (VIA.B) stock was down 83 cents at $33.81 after the company, whose holdings include CBS, MTV and the Paramount movie studio, said Tuesday its board approved a previously announced plan to split in two. One company will be focused on broadcast TV, the other will be built around cable networks.

Tommy Hilfiger Corp. (TOM) stock was up 11 percent, or $1.22, at $12.46, after it said it was delaying financial statements for the fourth quarter and fiscal 2005, as a result of the previously disclosed regulatory probe.

Trading was fairly active, with 1.39 billion shares changing hands on the New York Stock Exchange, compared with the 1.46 billion daily average for last year. About 1.71 billion shares were traded on Nasdaq, just under the 1.81 billion daily average last year.

Advancers outnumbered decliners on the New York Stock Exchange by a ratio of about 5 to 3, while on the Nasdaq, about 17 stocks rose for every 13 that fell.

The Russell 2000 index of smaller companies rose 2.80, or 0.4 percent, to 637.19.

Overseas, Japan's Nikkei stock average rose 0.71 percent. In Europe, France's CAC-40 was down 0.32 percent, Britain's FTSE 100 shed 0.54 percent and Germany's DAX index was down 0.94 percent.

Reuters and the Associated Press contributed to this report.