Gold futures closed with modest gains on Tuesday on speculation a weak dollar and soaring energy cost will boost the demand for the precious metal while another round of weak U.S. data boosted concerns about economic growth.

Gold for August delivery closed up 60 cents to $886.90 an ounce on the Comex division on the New York Mercantile Exchange. The precious metal hit an earlier low of $876.70 earlier in the session.

It was back to the dollar as the prime mover for gold, said Jon Nadler, a senior analyst at Kitco Bullion Dealers.

Credit losses and related apprehensions continue to represent an undercurrent of potentially restraining effects on the dollar's recent buoyancy.

For the meantime, the range for gold is still tight [within the $875-$895 band], but the action could start to perk up as we tip into the latter half of the week, he said.

The Labor Department reported prices paid to U.S. producers in May rose at an annual rate of 7.2 percent. Meanwhile, U.S. home builders started construction on 3.3 percent fewer homes in May, with housing starts dipping to a 17-year low, the Commerce Department reported.

The dollar fell for a second straight day against the euro on signs the Federal Reserve may keep interest rates steady.

Crude-oil futures for July delivery rose to a record intraday high of $139.89 a barrel on Monday in electronic trading on Globex, before ending that session modestly lower. On Tuesday, July crude closed at $134.01 a barrel on concerns that oil demand will slow and Saudi Arabia is widely expected to announce an increase in production at a meeting of oil producers and consumers this weekend.

July silver fell by 15.5 cents, or 0.9 percent, to end at $17.075 an ounce on the Nymex. Before today, the price advanced 16 percent this year, while gold climbed 5.8 percent.

July copper closed at $3.6495 an ounce, down 2.05 cents. July platinum gained $13.60 to finish at $2,064.30 an ounce, and September palladium declined by 60 cents to close at $463.85 an ounce.