NEW YORK (MarketWatch) -- U.S. stocks edged higher after a shaky start, as investor optimism stemming from Best Buy Co. Inc.'s results and hopes for Friday's employment report competed with Federal Reserve Chairman Ben Bernanke's talk on Capital Hill.
"We're still up on the day, based on hopes that nonfarm payrolls will be better than expected. But it's hard to hold onto that after the big rally we had yesterday," said Art Hogan, chief market strategist at Jefferies & Co.
After an attempting rise and early fall, the Dow Jones Industrial Average gained 21.25 points to 12,673.25, with 17 its 30 components trading lower.
"The bottom line is the Fed has downgraded the near-term economic outlook since its latest round of projections," said Stephen Stanley, chief economist at RBS Greenwich Capital.
"The market's hesitations are also a reflection of what's going on with Bernanke's testimony. Those congressmen represent their constituents, people who have had trouble keeping their homes, and they're facing a man that has just rescued Bear Stearns; even if it was to save the financial system, it reeks of a Wall Street bail-out," said Hogan.
Financials, which led Tuesday's rally, continued to show some strength among the blue chips, with Citigroup Inc. up 4% and J.P. Morgan Chase & Co. gaining 0.6%.
The S&P 500 climbed 5.26 points to 1,375.44, while the Nasdaq Composite gained 13.84 points to 2,376.59
While the broad market lapsed, shares of retailers drew a boost from better-than-expected guidance and fourth-quarter results from Best Buy , with shares of the nation's largest electronics retailer up 2%. .
Shares of other retailers gained as well. .
Volume on the New York Stock Exchange neared 1.3 billion, while 283 million shares were exchanged on the Nasdaq. Advancers led decliners on both exchanges, by nearly 2 to 1 on the NYSE and about 3 to 2 on the Nasdaq.
Ahead of the opening, stock index futures added to earlier gains after an ADP report found the private sector added 8,000 jobs in March, with the data coming two days before Friday's pivotal employment report. .
In early activity on the New York Mercantile Exchange, gold edged up after two sessions of sharp losses; gold for June delivery climbed $6.6 to $889.5 an ounce. .
Elsewhere on the NYME, crude-oil futures gained, with the contract for May delivery up 64 cents at $101.62 a barrel, following Tuesday's 60-cent drop to $100.98 a barrel. .
A drag on the pharmaceutical sector, shares of Pfizer Inc. fell after the drug company late Tuesday said it was stopping a study of an experimental drug for melanoma.
Overseas, European shares extended second-quarter gains as banks such as UBS AG advanced. .
By Kate Gibson