Drilling stocks are rising as oil leaps on hopes of an OPEC deal

Energy stocks led U.S. markets higher Wednesday as oil prices surged on hopes that a deal from OPEC may cut back production.

Oil drilling stocks, or those focused on exploration and production, were the best performers in the sector. Oklahoma City-based Devon Energy leaped more than 13.5 percent in morning trade, while Marathon Oil and Transocean climbed more than 10.5 percent, and Diamond Offshore Drilling rose 9 percent.

Shares of Helmerich & Payne were about 5 percent higher.

"At this point, if this (OPEC deal) is true, this is definitely a bullish perspective for all oil stocks, especially upstream," the exploration and production companies, said Luana Siegfried, energy equity research associate at Raymond James.

Reports indicated that OPEC struck a deal in Vienna on Wednesday, though the cartel had yet to make any formal announcement as U.S. markets opened.

U.S. oil futures for January delivery briefly leaped more than 8 percent to above $49 a barrel, their highest since Nov. 22. Brent crude futures for January delivery climbed above $50, their highest since late October.

"For all E&P stocks, this is a bullish call for sure, because price is directly correlated with cash flow," Siegfried said. Raymond James expects U.S. crude to reach $60 by the end of the year, and the firm has a strong buy rating on Marathon Oil and an underperform rating on Exxon Mobil.

Oil prices were higher after a source said the Organization of the Petroleum Exporting Countries had agreed on a plan to cut output based on an outline hammered out in Algiers in September, Reuters said.

Earlier, crude prices had already climbed after Saudi Arabia's energy minister, Khalid al-Falih, said OPEC members were "getting close to a deal" on a potential production cut. Oil prices have lost more than half their value since 2014 due to oversupply.

If a deal is struck, analysts forecast that oil could rise to $50 a barrel and above, but if not, it could drop to $40 or below.

However, as oil prices recover the benchmark $50 level, that could encourage a revival of U.S. shale oil production. The weekly U.S. oil rig count rose by three to a total of 474 last week, versus 555 a year ago, according to Baker Hughes.

The Energy Select SPDR Fund ETF (XLE) climbed more than 3.5 percent in morning trade, while Dow components Exxon Mobil and Chevron rose about 2 percent or more. Shares of oilfield services giant Baker Hughes gained more than 3.5 percent.

U.S. stocks hit record highs in Wednesday morning trade.

— CNBC's Patti Domm contributed to this report.