Updated from 4:19 p.m. EST

Gains in energy, mining and housing stocks helped the market overcome a slow start and rally to a higher close Tuesday.

The Dow Jones Industrial Average rose 56.64 points, or 0.45%, to 12,533.80, and the S&P 500 tacked on 5.04 points, or 0.35%, at 1427.99. The Nasdaq Composite eked out a gain of 0.34 points, or 0.01%, at 2431.41.

Roughly 3.03 billion shares changed hands on the New York Stock Exchange, where advancers beat decliners by a 2-to-1 margin. Volume on the Nasdaq topped 2.04 billion shares, with winners outpacing losers 3 to 2.

"The market is back in a trading range, or perhaps it never left," said Ken Tower, chief market strategist with CyberTrader. "The S&P has been buoyed no doubt by this week's strength in energy shares. The longer-term rally remains intact."

Supporting the advance was a 4.7% climb in the Amex Gold Bugs index, a 2.9% rise in the Philadelphia Oil Service Sector index and a 2.4% gain in the Philadelphia Stock Exchange Housing Sector index.

Commodities prices surged. The newly benchmarked March crude oil futures contract was up $2.46 at $55.04 a barrel. Natural gas gained 28 cents to $7.60 per million British thermal units.

Gold jumped $11.80 to close at $645.90 an ounce, and silver was up 26 cents at $13.26 an ounce.

Meanwhile, Wall Street had plenty of corporate earnings to digest, including several from Dow components.

Among them, Johnson & Johnson ( JNJ) posted fourth-quarter net income of $2.17 billion, or 74 cents a share, up more than 13% from the year-earlier quarter. Before items, the health care giant earned 81 cents a share, beating the Thomson First Call average estimate. J&J slipped 68 cents, or 1%, to $66.50.

Elsewhere, United Technologies ( UTX) exceeded fourth-quarter estimates and reaffirmed its outlook for this year, while fellow industrial DuPont ( DD) met estimates. United Tech shares added 3.2%, while DuPont closed down 0.9%.

In the banking sector, Wachovia ( WB) saw fourth-quarter earnings rise 34% from a year ago, beating Wall Street estimates. Bank of America ( BAC) posted fourth-quarter net income that jumped 47% and was also ahead of the Thomson First Call consensus.

Wachovia tacked on 0.7% to $56.65, and Bank of America dipped 0.6% to finish at $53.32.

As for those that disappointed, Alcatel-Lucent ( ALU) warned that it will miss analysts' fourth-quarter sales estimates by a significant margin. The company expects to have revenue of around $5.02 billion, falling short of the consensus target by about $300 million. Alcatel tumbled 7.3% to $13.15.

Homebuilder D.R. Horton ( DHI) said fiscal first-quarter earnings dropped to $109.7 million, or 35 cents a share, down 65% from a year ago. Still, results trumped the average estimate by 2 cents. Shares rose $1.24, or 4.6%, to close at $28.37.

Xerox ( XRX) said fourth-quarter income fell 24% from the year-ago quarter to $214 million. Excluding restructuring-related charges, the company earned 38 cents a share, beating estimates by a penny. Still, Xerox was off 17 cents, or 1%, at $16.53.

"The reports from the technology sector have been generally upbeat; however, comments regarding the future are much darker, taking many of the stocks lower," said Paul Nolte, director of investments with Hinsdale Associates. "However, their impact has not been felt marketwide as would an employment report or a wider-than-normal inflation release. While the bulls and bears have been battling to gain the upper hand, the markets have frustrated both."

The economic docket was light for a second straight session. In the day's only release, the Conference Board said that leading economic indicators rose 0.3% in December, above economists' expectations of a 0.2% rise. However, October's number was revised down by 0.2% and November by 0.1%.

Treasuries were losing ground. The 10-year note was off 10/32 in price to yield 4.80%, and the 30-year bond was down 23/32, yielding 4.90%.

Overseas, European shares were mixed. The London FTSE 100 was higher by 0.2% at 6227, while the Frankfurt Xetra DAX was falling 0.1% to 6678. Asia's stocks eased overnight. Tokyo's Nikkei lost 0.1% at 17,408, and Hong Kong's Hang Seng was off 0.01% to 20,769.