Oil prices reached their highest level in nearly a year earlier this week. For investors looking to play this trend, here are some energy stocks with the greatest long-term upside potential. Energy is the only winning sector in the S & P 500 this month, managing gains of about 2.6%. The sector has added 0.5% this week as oil prices rallied from news of extended voluntary oil supply cuts from Saudi Arabia and Russia until year-end. CNBC Pro used FactSet data to search for energy companies in the S & P 500 that not only stand to benefit from a jump in oil prices but that are also loved by analysts. We screened for stocks that are buy-rated by more than 60% of the analysts who cover them and that are expected to have upward of 10% upside over the next 12 months based on analysts’ consensus price target. Here are the stocks that made the cut: Marathon Oil and Texas-based natural gas infrastructure company Targa Resources are the clear energy winners of the broader index, with 21.5% and 20.5% upside, respectively, according to analysts. Nearly two-thirds of analysts rate Marathon Oil a buy. The stock, which is up nearly 17% this quarter, was also the most positively correlated stock to oil out of the Russell 1000, according to a recent CNBC Pro screen . Halliburton was the second-most loved stock to Targa, with 80% of analysts rating the oilfield services giant a buy. Of the list, the stock is the biggest winner so far this quarter — with gains of more than 24%. Oil and natural gas company Diamondback Energy is another name on the list. About 77% of analysts rating the stock a buy, with the average price target implying more than 11% upside. Shares have popped about 18% this quarter. Earlier this week, Diamondback subsidiary Viper Energy Partners announced it is acquiring certain mineral and royalty interests from affiliates of Warwick Capital Partners and GRP Energy Capital for roughly $1 billion in cash and stock. The deal brings the company about 4,600 net royalty acres in the Permian Basin and an additional 2,700 net royalty acres in other major basins. Natural gas producer EQT , oil and gas giant EOG Resources , as well as petroleum refining and marketing company Valero Energy , are also Wall Street favorites. Mizuho Securities’ analyst Nitin Kumar highlighted Valero and EQT as “key picks” in a June note, adding they “screen well on our force-ranking system that we refer to as our Energy Investment Framework.” More than 62% of analysts gave EQT a buy rating, expecting almost 15% upside for the company. While the stock has added less than 2% this quarter, it is the winner on the list in terms of year-to-date gains of about 24%. For investors looking for energy stocks but who do not want to bet on individual names, the Energy Select Sector SPDR Fund (XLE) and the iShares U.S. Energy ETF (IYE) track companies in the sector. XLE has an expense ratio of 0.1% and a total return of more than 6% in 2023. IYE carries an expense ratio of 0.4% and has a total return of 4.6% year to date. — CNBC’s Michael Bloom contributed to this story.