The Dow Jones Industrial Average gained 23 points to 13,635, as 17 of its 30 components advanced, led by the likes of IBM , Verizon Corp. , and General Electric Co. , whose shares topped a 52-week high.
Also among blue chips, home-improvement retailer Home Depot Inc. rose 0.7% after reports that it has agreed to sell its building supply unit for $10 billion.
Retailers remained under pressure as Best Buy Co. Inc. fell 6.2%. The company posted an 18% decline in quarterly profit, as the popularity of lower-margin notebook computers and gaming hardware ate into profits, and pruned its forecast for the year.
Other electronics retailers fell in unison, including Circuit City , which reports earnings on Wednesday, RadioShack Corp. and Tweeter .
"The stock market is exposed to disappointments on the earnings front and/or weaker consumer spending," said Bob Doll, global chief investment officer at BlackRock. "As such, we expect the consolidation in the major stock indexes seen in the past several weeks to persist."
The S&P 500 gained 2.6 points to 1,533, while the Nasdaq Composite lost 1.3 points to 2,627.
Among tech shares, Yahoo Inc. dropped 1.7% after the Internet search giant and Google Inc. rival named co-founder Jerry Yang as chief executive, replacing Terry Semel.
Trading volumes showed 1.1 billion shares exchanging hands on the New York Stock Exchange and 1.5 billion trading on the Nasdaq stock market. Gaining issues topped decliners by 9 to 7 on the NYSE and by 15 to 13 on the Nasdaq.
By sector, internet shares led the gains, along with airlines , while semiconductors , oil and broker/dealers all fell.
Homes and rates
Starts of new U.S. homes fell by 2.1% to a seasonally adjusted annual pace of 1.47 million in May, as building permits for new construction rose 3% to 1.50 million on a jump in multifamily dwellings, the Commerce Department estimated Tuesday. The figures were slightly stronger than economists expected.
"The fact that building permits are up is a sign that there might be some consolidation in housing," said Peter Cardillo, chief market economist at Avalon Partners. "But yesterday, the [National Association of Home Builders'] housing index was at its lowest in 16 years."
The bond market, where prices have come under pressure and yields have spiked over the past couple of weeks, failed to react much to the latest housing news. The benchmark 10-year Treasury bond finished up 13/32 to 95 16/32, yielding 5.086%.
Higher bond yields had pressured the stock market over the past couple of weeks, as they provide a risk-free alternative to stocks, while also raising borrowing costs for consumers and businesses.
"Higher yields have now been discounted by the market," said Avalon's Cardillo. "Some of the economic data that we're continuing to see has come better than expected, and the market is now seeking a consolidation level."
But "one major negative that this market could endure is if we see oil heading towards $72 [a barrel]."
Crude oil did move up slightly, adding 1 cent to finish at $69.10. It earlier reached $69.56 a barrel amid concerns about a production strike in Nigeria and refining capacity in the U.S.
In other markets, the dollar was lower against the euro and the yen.
Gold reversed early weakness, tracking crude oil, gaining $4.80 to close at $664.70 an ounce.
Bristol-Myers Squibb Co. gained 3.9% after the Food and Drug Administration granted priority review for its ixabepilone breast cancer drug.
By Nick Godt