Oil prices had soared 5% Tuesday, but gave up all those gains as hopes of a deal to cut production fizzled.

Oil ministers from Saudi Arabia and Russia met Tuesday and agreed to a tentative deal to freeze production -- a small step that won't meaningfully impact the massive supply glut.

Also participating in the meeting were representatives from Qatar and Venezuela, according to a source who attended the meeting. After trading above $31, the price of oil fell back below $30.

Though there was little progress, some observers were still hopeful that key players were at least talking. Officials stressed that discussions would continue.

"We will start intensive communication almost straight away with other major producers, OPEC, non-OPEC, including Iran and Iraq," said the Qatari minister of energy and industry.

Saudi Arabia's oil minister said: "We don't want significant gyrations in prices. We want to meet demand and we want a stable oil price." However, the Saudi minister added: "We don't want reduction in supply."

World markets are still awash with oil because OPEC and Russia are pumping out barrels at a record rate, and U.S. shale production is falling only very slowly.

At the same time, demand is faltering due to weaker global economic growth.

OPEC members such as Nigeria and Venezuela have been leading the calls for a coordinated production cut to boost prices, but Saudi Arabia and other low cost producers in the Gulf have thus far refused to play ball.

Related: Why Saudi Arabia and Russia are still flooding the market

They worry that without a broader agreement including producers outside the cartel, and Russia in particular, OPEC would simply surrender more of its shrinking market share.

Several rounds of exploratory talks have taken place in the past few months, fueling oil price volatility as traders bid up prices in the hope of a deal only to sell again when the effort falls flat.

Tuesday's meeting brought together the global oil market's top two exporters.

-- Matt Egan contributed to this article.