Stocks inched up Thursday as a decrease in oil prices and strength in the retail sector offset a government report showing an increase in labor costs.

The Dow Jones industrial average (search) gained 3.62 points, or 0.03 percent, to close at 10,553.49. The Standard & Poor's 500 Index (search) added 2.07 points, or 0.17 percent, to end at 1,204.29. The technology-laced Nasdaq Composite Index (search) rose 9.94 points, or 0.48 percent, to finish at 2,097.80.

Investors were waiting to make major moves until they saw tomorrow's May U.S. payroll report.

"We've got very important employment numbers coming up tomorrow and a lot of people are holding back," said Hugh Johnson, chief investment officer at Johnson Illington Advisors of Albany, New York.

The Labor Department (search) reported that unit labor costs, a key inflationary indicator, rose at a faster-than-expected rate in the first quarter. That tempered -- but didn't extinguish -- Wednesday's enthusiasm that the Federal Reserve was close to the end of its campaign of interest-rate hikes.

"Are we in that perfect 'Goldilocks' kind of economy, or are the numbers here pointing to new problems?" said Jay Suskind, head trader at Ryan Beck & Co. "So in front of tomorrow's employment numbers, the market lays an egg and we wait."

The Labor Department report showed that unit labor costs increased at a 3.3 percent annual rate in the first quarter, far sharper than the 2 percent increase that was forecast.

Stock indexes trimmed losses as crude oil prices retreated from a session high at $55.40 hit in the morning. U.S. crude for July delivery fell 97 cents on the New York Mercantile Exchange (search) to settle at $53.63 a barrel after government data showed an increase in crude inventories.

The bond market edged higher after Wednesday's sharp rally, which sent Treasury yields to nearly year-long lows. The yield on the 10-year Treasury note rose to 3.90 percent from 3.89 percent late Wednesday. The dollar lost ground against most major currencies, while gold prices rose.

Despite the economic concerns and the unusual activity in the bond market, analysts were encouraged that the stock markets did not sell off substantially after the gains of the past month.

"We're seeing a little pause here, but we're in the middle of a powerful uptrend, and traders should be looking at every dip in the market to find a new entry point," said Ken Tower, chief market strategist for Schwab's CyberTrader.

Wal-Mart Stores Inc. (WMT) gained 30 cents to $48.22 after reporting a 2.5 percent increase in sales at stores open at least a year, on par with Wall Street's expectations. Costco Wholesale Corp., which surpassed Wall Street forecasts, was up $1.06 at $46.62, while home decor retailer Pier 1 Imports Inc. dropped 89 cents to $15.74 after missing its sales estimates and warning that its second-quarter profits would be lower than expected.

Dow industrial Citigroup (C) slipped a penny to $47.71 after the company announced it would buy the $6.6 billion credit card businesses of merger partners Federated Department Stores Inc. and May Department Stores Co. for a total $760 million. Federated rose $1.39 to $69.09, while May added 40 cents to $38.71.

A report in The New York Times had Citigroup in talks with Legg Mason Inc. to swap Citi's mutual fund and asset management divisions for Legg Mason's brokerage network, along with cash and stock. Legg Mason climbed $2.63 to $86.92.

In the technology sector, Sun Microsystems Inc.(SUNW) fell 11 cents to $3.79 after it said it would buy Storage Technology Corp.(STK) for $4.1 billion. The acquisition gives Sun, which makes computer servers, added storage services to offer its customers. StorageTek surged 16.4 percent, or $5.13, to $36.36.

Retail shares generally gained, after stores posted better-than-expected May sales results. The Standard & Poor's Retail index was up 1.12 percent at 445.69.

"The retailers have been sort of, with the exception of the high end, having a bit of a struggle here in the last couple of months," said John O'Donoghue, managing director of listed trading at Credit Suisse First Boston, of New York. "Any kind of good news will lift them."

Costco (COST) shares rose 2.3 percent, or $1.06, to $46.62. Target Corp. (TGT) climbed 1.5 percent, or 83 cents, to $54.65 and drug-store chain CVS Corp. (CVS) jumped 3.9 percent, or $2.15, to $57.25.

Airline stocks rallied after Continental Airlines Inc. (CAL) and American Airlines (AMR) posted stronger May traffic. Continental shares gained 8.2 percent, or $1.11, to $14.67 and American Airlines parent AMR Corp. advanced 8 percent, or $1.01, to $13.72.

Trading was fairly active, with 1.40 billion shares changing hands on the NYSE, below the 1.46 billion daily average for last year. About 1.81 billion shares were traded on Nasdaq, matching the 1.81 billion daily average last year.

The number of shares that gained in value exceeded the number that declined on the NYSE by almost 21 to 13. Advancers outnumbered decliners on Nasdaq by a ratio of 8 to 7.

The Russell 2000 index of smaller companies was up 1.50, or 0.24 percent, at 625.24.

Overseas, Japan's Nikkei stock average fell 0.44 percent. In Europe, Britain's FTSE 100 was down 0.12 percent,France's CAC-40 climbed 0.13 percent for the session, and Germany's DAX index rose 0.11 percent.

Reuters and the Associated Press contributed to this report.