Traders were looking for clues as to what the Fed might do to stimulate the economy. The Fed chairman, in the first of two back-to-back appearances on Capitol Hill -- with the second scheduled for Wednesday -- warned the economic recovery faced headwinds.
Asked direct policy questions, Bernanke said policy makers were willing to act, but gave no specific indication of how or when.
By close of trading in New York, light, sweet crude for August delivery climbed to $89 per barrel after starting the day at $87.88 per barrel on the New York Mercantile Exchange.
Henry Hub natural gas lost 0.08 cents to $2.788 per million British thermal units.
Home heating oil was off 0.87 cents in late trading to $2.8335 per gallon.
Reformulated blendstock gasoline gained 0.35 cents to $2.8485 a gallon.
At the pump, the national average price of unleaded gasoline was $3.406 per gallon Tuesday, up from Monday's $3.396, AAA said.