The fascinating thing about investing in the oil sector is how many stocks in the space are directly influenced by oil prices. In other words, historically speaking, they tend to follow the direction of the price of oil. That's a consideration that springs to mind when looking at Halliburton's (HAL -2.52%) latest set of earnings. The price of oil is now above $80 a barrel, and the oil services company's management gave a very bullish outlook for the industry. Is now the time to buy?

The case for oil sector stocks

In a nutshell, the collapse in the price of oil from above $100 a barrel in 2014 to less than $40 a barrel at the start of 2016 caused a severe contraction in investment spending, which is now "starting to have an effect on the supply side," according to Halliburton CEO Jeff Miller on the earnings call

Dozens of blue oil barrels.

Image source: Getty Images.

As such, Miller believes that the oil supply is not lining up with demand, resulting in higher prices. He noted that that "asset owners are eager to reverse baseline production declines caused by multiple years of underinvestment." Miller believes it's the "beginning of an upcycle" for oil and gas spending.

Halliburton's bullish outlook

In support of the optimistic outlook, CFO Lance Loeffler said Halliburton is preparing for a surge in demand by "pulling forward spending on long lead time items for our premium equipment" and ramping capital spending to $800 million for the full year. The $800 million figure is within management's target of 5%-6% of revenue, based on current analyst estimates for Halliburton to generate $15.1 billion in revenue in 2021.

However, since the price of oil started the year closer to $50, management had likely penciled in a far lower absolute figure for revenue and therefore capital spending in 2021.

Whichever way you look at it, Miller is bullish, and Halliburton is preparing to reap the benefits of a long-awaited upswing in the industry. In support of this optimism, Miller said, "In North America, we expect customer spending to increase in and around 20% next year, including solid net pricing gains." For reference, Wall Street analysts have Halliburton achieving 17% sales growth in 2022. 

A long-term upswing is in place

Many of the themes discussed above are in the chart of Halliburton segment revenue below. The collapse in the price of oil led to a slump in revenue as oil and gas exploration and production companies cut spending in response -- terrible news for Halliburton.

Chart showing Halliburton's segment revenue.

Data source: Halliburton presentations.

However, with the price of oil now at a level not seen since 2014 and the U.S. and global oil rig counts on the rise, the medium-term outlook is positive.

US Oil Rig Count Chart

Data by YCharts.

Two points of concern

It wouldn't be surprising if Halliburton and the oil services sector went higher in the near term. However, there are a couple of points of concern.

First, it's far from clear just how much of the recent move in the price of oil comes down to the interplay of surging demand caused by the reopening of the economy combined with the lingering impact of the COVID-19 pandemic on the global supply chain. Companies across swathes of industries have reported labor difficulties and logistics issues as the world gets back to work.

It's a theme that investors will hear a lot about in the coming weeks during earnings season, and the same trends may be playing out in the energy markets. This is not to say that there isn't an uptick in energy spending coming, but that it might not be quite as strong as the market thinks it will be.

An oilfield worker.

Image source: Getty Images.

The second argument is that, even if you are bullish on the price of oil, it may make more sense to buy exploration and production companies instead. The chart below compares a couple of widely purchased exploration and production ETFs, the iShares U.S. Oil & Gas Exploration and Production ETF (IEO -1.10%) and the SPDR S & P Oil & Gas Explorer and Producer ETF (XOP -1.69%) with a bunch of oil equipment and services ETFS, Halliburton is a major holding in all of the ETFs in the chart.

Whichever way you look at it, the exploration and production stocks have trounced oil services stocks in recent years. One of the reasons for this could be the growth of renewable energy and its acceptance as a source of future energy supply. However, renewable energy threatens both exploration and production and oil services companies.

The idea is that exploration and production companies can use the cash flows generated from production from their oil reserves to invest in other technologies such as hydrogen fuels, fuel cells, carbon capture and storage, and renewable energy itself. In this way, they can diversify away from over time if necessary. After all, it's been more than 20 years since British Petroleum became BP (BP -0.85%) and promptly adopted the slogan "Beyond Petroleum."

On the other hand, it will prove harder for oil services companies to reinvent themselves, and weak oil volumes usually mean weak revenue for oil services companies. 

XOP Chart

Data by YCharts.

Stocks to buy?

All told, if you are looking to buy into the sector with a bullish view on oil prices, it may make more sense to purchase exploration and production stocks rather than equipment and services stocks as a long-term investment. Both subsectors will do well in a rising price environment, it may make more sense to buy the former (exploration and production) stocks right now.