U.S. stocks rose modestly Tuesday as energy shares advanced on higher oil prices and overshadowed a warning on inflation from Federal Reserve Chairman Ben Bernanke.

The Dow Jones industrial average was up 14.74 points, or 0.12 percent, at 12,136.45. The Standard & Poor's 500 Index was up 4.82 points, or 0.35 percent, at 1,386.72. The Nasdaq Composite Index was up 6.69 points, or 0.28 percent, at 2,412.61.

Click here to visit FOXBusiness.com's Investing Center.

Shares of Exxon Mobil Corp. (XOM), the biggest publicly traded oil company, rose 2.3 percent, or $1.69, to $74.16 as the price of U.S. crude oil advanced 1.1 percent on forecasts of colder weather in the United States.

"We've seen about a $2 dollar move on oil prices since pre-Thanksgiving and that's picked up the international oil stocks and related oil services companies and has provided the leadership right now," said Fred Dickson, market strategist with D.A. Davidson & Co. in Lake Oswego, Oregon.

Bernanke said in a speech the U.S. economy is poised to expand at a moderate rate but that risks of higher inflation still remain, dimming hopes for an interest-rate cut any time soon.

In addition to Bernanke's comments, Philadelphia Federal Reserve President Charles Plosser said U.S. interest rates may not be high enough to quell inflation.

"There has been a consistent pattern out of these guys trying to talk the market out of the silliness of a rate cut in the first half of the year," said Dave Francis, a vice president of equities with Thrivent Asset Management in Appleton, Wisconsin.

Stocks moved between positive and negative territory throughout the session, driven by mixed economic data. Reports showed unexpectedly pronounced weakness in durable goods orders and consumer confidence, but surprising growth in the battered housing sector.

Lingering concerns about the dollar's recent sell-off also somewhat limited gains, traders said.

The dollar's recent drop has hurt demand for U.S. investments, causing the three major U.S. stock indexes to register their worst day in months on Monday.

Exxon Mobil's stock gave the biggest boost to both the blue-chip Dow average and the broad S&P 500. Shares of other large energy companies, including Chevron Corp. (CVX), also rose and bolstered the S&P 500. Chevron's stock gained 1.6 percent, or $1.13, to $69.88 on the NYSE.

U.S. crude oil for January delivery rose 67 cents to settle at $60.99 a barrel on the New York Mercantile Exchange.

Interest-rate-sensitive shares such as Caterpillar Inc. (CAT) fell. The heavy equipment maker was a drag on the Dow, with its stock losing 0.6 percent, or 37 cents, to $61.60.

On the Nasdaq, shares of Apple Computer Inc. (AAPL) climbed 2.5 percent, or $2.27, to $91.81 after UBS raised its price target on the company's stock.

Volume was active on the NYSE, where about 1.60 billion shares changed hands, slightly below last year's daily average of 1.61 billion. On Nasdaq, about 2.01 billion shares traded, above last year's daily average of 1.80 billion.

Advancing stocks outnumbered declining ones by a ratio of about 2 to 1 on the NYSE and about 8 to 7 on Nasdaq.

Click here to visit FOXBusiness.com's Investing Center.