Updated from 1:02 p.m. EDT

Energy contracts declined and precious metals rose, while agricultural futures were mixed Wednesday.

Crude oil for April delivery was down $3.38 at $42.33 a barrel at the New York Mercantile Exchange. Heating oil was off almost 7 cents, and gasoline futures were down more than 4 cents. Natural gas ticked lower.

Prices declined after the Energy Department released its latest data on inventories. The government said crude stocks rose by 749,000 barrels in the week ended March 6, easily exceeding estimates for a build of around 200,000 barrels.

Gasoline inventories were the story, though, declining by a much bigger-than-expected 3 million barrels. Distillate inventories, meanwhile, rose by 2.1 million barrels, much higher than what had been projected by analysts.

As for precious metals, gold was up $14.80 at $910.70 an ounce, and silver gained 26 cents to $12.80 an ounce. Platinum and palladium advanced.

On the ag side, cocoa, coffee, frozen concentrated orange juice and cotton rose, but wheat, corn and soybeans fell. Meanwhile, cattle and hogs were little changed. In foreign-exchange trading, the dollar retreated against its major counterparts.

As for commodity-related stocks, oil majors Exxon Mobil ( XOM) and Chevron ( CVX) pulled back. Miner Freeport-McMoRan ( FCX) added 4.1% to $35.56.

Seed and ag concern Monsanto ( MON) was up 4.6% at $81.24. Bunge ( BG) lost 2.2% to $50.22, and Potash Corp. of Saskatchewan ( POT) climbed 4.2% to $78.14.

The Market Vectors Agribusiness ( MOO) exchange-traded fund was up 2.4% at $27.36, and the U.S. Oil ( USO) fund was down 5.5% at $26.30. The Gold Shares ( GLD) were better by 1.2% at $89.22.

If you liked this article you might like

How to Invest in Oil

How to Invest in Oil

Jim Cramer: These 4 Stocks Seem Attractive Right Here

Jim Cramer: These 4 Stocks Seem Attractive Right Here

Occidental, RSP Permian Pumping More Shale Oil Than Expected, Goldman Says

Occidental, RSP Permian Pumping More Shale Oil Than Expected, Goldman Says

How I'm Playing Infrastructure, Oil and Defense Stocks Right Now

How I'm Playing Infrastructure, Oil and Defense Stocks Right Now

Volatility Is Still in Charge: Cramer's 'Mad Money' Recap (Friday, 2/9/18)

Volatility Is Still in Charge: Cramer's 'Mad Money' Recap (Friday, 2/9/18)