Stocks rebounded from an earlier slump to close higher Wednesday, fueled in part by record-high oil prices that boosted energy stocks.

The Dow Jones industrial average gained 62.24 points, or 0.61 percent, to close the session at 10,239.92. The technology-laced Nasdaq Composite Index rose 15.53 points, or 0.79 percent, to end at 1,971.03, while the broader Standard & Poor's 500 index was up 7.57 points, or 0.67 percent, to end at 1,142.05. All three indexes had spent most of the session hovering near unchanged levels.

As the fourth quarter's active trading continued, the S&P 500 closed at its highest point in about three and a half months. The tech-heavy Nasdaq index finished at its highest level since July 2, ending higher for the 7th consecutive session. The last time that happened was over four months ago.

Light, sweet crude for November delivery added 93 cents to $52.02, as traders examined weekly U.S. inventory numbers. Crude inventories for the first week of October were up 1.1 million barrels; gasoline stocks were also higher, but a 2.1 million barrel decline in distillate fuels, which includes heating oil and jet fuel, suggests consumer spending may come under some pressure this winter.

Oil has jumped nearly 60 percent so far this year and has stoked concerns that higher energy costs will eat into corporate profits and curb consumer spending.

The higher price of oil has been a boon for oil companies like Exxon Mobil Corp. (XOM) and ChevronTexaco Corp. (CVX), which both rose to 52-week highs on rising oil prices. Exxon closed up 1.4 percent at $50.03 and ChevronTexaco rose 1.8 percent to $55.41.

"The market is actually putting on a pretty good performance in the face of this oil move up to new highs," said Jay Finkel, senior equity trader at Lord Abbett.

Analysts were also watching for positive signs in third-quarter earnings reports, following a series of profit warnings. A number of large companies are preparing to issue results, including Costco Wholesale Corp. (COST), Marriott International (MAR) and Alcoa Inc. (AA) on Thursday, and General Electric Co. (GE) on Friday.

"What you would hope now is that we'll see some upside surprises," said Janna Sampson, co-Manager of the AmSouth Select Equity Fund and director of Portfolio Management at Oakbrook Investments. "That could buoy the market and help us take off. Until we get numbers out of those companies that haven't warned, I think we're somewhat directionless. There's just nothing fundamental to drive the market until then."

3M Co. (MMM) rose 3 percent to $81.14, giving the Dow momentum, after a Deutsche Bank analyst said he believes 3M is on track to meet third-quarter financial estimates.

Merck & Co. (MRK) weighed on the Dow and Standard & Poor's 500 stock gauges after the Wall Street Journal reported that Merck's drug Vioxx (search) may have led to more than 27,000 heart attacks and sudden cardiac deaths before it was withdrawn, suggesting the company may face more legal liability. Merck was down 5.26 percent, or $1.76, to $31.67 on the NYSE.

Investors were also eying the ramifications of the shortage of flu vaccine following the British government's suspension of Chiron Corp.'s (CHIR) manufacturing license. Chiron, which provides about half of the flu vaccine used in the United States, added 34 cents at $38.32, following an 18 percent drop on Tuesday. The company slashed its earnings guidance and was downgraded by several brokerage firms.

Shares of Sirius Satellite Radio Inc. (SIRI) rose after popular radio personality Howard Stern said he will broadcast on Sirius beginning in 2006. He was dropped earlier this year from several broadcast stations that objected to his off-color humor. Sirius gained 16 percent, or 52 cents, to $3.87 on the Nasdaq. Sirius' main rival, XM Satellite Radio Holdings Inc. (XMSR), fell 48 cents to $29.

Further raising concern about a possible slowdown in consumer spending, Big Lots Inc. (BLI) blamed soft sales in September on the difficult economic environment. The nation's largest closeout retailer adjusted its earnings and sales forecasts to reflect what it sees as a broad-based trend. Big Lots sank 4.6 percent, or 59 cents, to $12.15.

In Washington, top officials with mortgage giant Fannie Mae (FNM), including chief executive Franklin Raines, defended the company's accounting practices before a House subcommittee. Regulators have alleged earnings manipulation and management misdeeds at Fannie Mae, which finances one of every five home loans in America. Fannie Mae was up $1.45 at $67.45.

Trading was active during the session, with 1.4 billion shares changing hands on the New York Stock Exchange, equal to the 1.4 billion daily average for last year. About 1.9 billion shares were traded on Nasdaq, above the 1.69 billion daily average last year.

The number of stocks advancing outnumbered those declining by more than 2-to-1 on the NYSE. On Nasdaq, nearly two stocks rose for every one that fell.

The Russell 2000 index, which tracks smaller company stocks, was up 5.32, or 0.9 percent, at 592.66.

Overseas, Japan's Nikkei stock average gained 0.9 percent. In Europe, France's CAC-40 dipped 0.2 percent, Britain's FTSE 100 was down 0.02 percent and Germany's DAX index added 0.02 percent.

Reuters and The Associated Press contributed to this report.