U.S. crude oil futures settled up $1.79, or 4.90 percent, at $38.29 a barrel, its highest settle since Dec. 4. Oil extended gains after weekly crude oil inventories showed a rise of 3.9 million barrels but a drop of 4.5 million barrels in gasoline inventories.
Hopes of curbing production also supported the rise in oil. An Iraqi oil official told state newspaper Al-Sabah that OPEC and non-OPEC members would meet in Moscow on March 20 to discuss an output freeze. However, Russian Energy Minister Alexander Novak said Wednesday that no time or place had been agreed for such a meeting this month, Reuters reported, citing the Russian TASS news agency.
Robert Pavlik, chief market strategist at Boston Private Wealth, said higher oil prices should have contributed to greater gains in stocks. "I think the ECB meeting is keeping a lid on the stock market. People are just not sure," he said.
Confidence in the effectiveness of monetary policy has waned since Draghi disappointed investors at the ECB's December meeting and the yen strengthened following the Bank of Japan's surprise move to negative rates in late January.
"That leads to a lack of credibility to central banks that adds another layer of uncertainty," said Bryce Doty, senior fixed income manager with Sit Investment Associates.
The major averages initially spiked following the surge in oil, before briefly giving up gains. The Dow Jones industrial average and Nasdaq composite temporarily fell into negative territory.
"We know that this is a week that we overreact to the inputs we get because they're few," said Art Hogan, chief market strategist at Wunderlich Securities.
Amazon recovered much of its intraday losses to close 0.14 percent lower and Apple squeezed out a 0.09 percent gain. The iShares Nasdaq Biotechnology ETF (IBB) closed down 1.15 percent, also above session lows.
Biotechs came under pressure amid a U.S. government health agency proposal that would change the way Medicare compensates doctors who administer drugs in their offices as a way to try to cut drug spending, Reuters said.
Chevron and IBM contributed the most to gains on the Dow, while Goldman Sachs and Nike were the greatest contributors to declines.
"It just feels like the only players in the market are momentum players," Deming said. "They're really short term, just trying to play these nuances and the shifts in sentiment."
The U.S. dollar index reversed to trade a touch lower, while the euro climbed above $1.10. The yen was at 113.29 yen against the greenback. Gold came well off lows after briefly hitting its lowest in almost a week.
Treasury yields were higher, with the 2-year at 0.89 percent and the 10-year at 1.88 percent.
The Treasury auctioned $20 billion of 10-year notes at a high yield of 1.895 percent. Demand was the weakest since August, following a poor auction of three-year notes on Tuesday, Reuters said.
Peter Boockvar, chief market analyst at The Lindsey Group, attributed some support to U.S. stocks from gains in European equities ahead of the ECB meeting.
"I think what we've seen over the past month is a bear market rally and what we hear from central bankers over the next week could mark the end of that," he said. To him, the bull market that celebrated its seventh anniversary Wednesday actually ended in the middle of last year.
Read More 7-year bull market may end in a 'blaze of glory'
As of the close Wednesday, the S&P 500 was up 194 percent since the close on March 9, 2009, marking the third-longest bull market in history.
"I think investors are just worrying how long is the bull market going to keep going," said Mike Bailey, director of research at FBB Capital Partners. "If you set aside equities and look at fundamentals, they're looking a bit better than maybe stocks might have indicated in February."