U.S. energy firms increased the number of oil rigs operating for the first time in the past three weeks as U.S. crude futures soared about 10% this week.

Big energy price declines over the prior couple of months, however, prompted one analyst to cut rig count forecasts for 2019 and 2020.

Companies added one oil rig in the week to June 21, bringing the total count to 789, Baker Hughes, a GE company, said in its weekly report. That compares with 862 rigs operating during the same week a year ago.

The rig count, an early indicator of future output, has declined over the past six months as independent E&P companies cut spending on new drilling as they focus more on earnings growth instead of increased output.

U.S. crude futures were trading around $57 per barrel on June 21, putting the contract up about 10% for the week on fears a U.S. military attack on Iran could disrupt flows from the Middle East.

Looking ahead, crude futures were trading around $57 per barrel for the balance of 2019 and $55 in calendar 2020.

Prior to this week, however, U.S. oil futures were down about 20% from a five-month high of $75.60 per barrel in late April. U.S. natural gas futures, meanwhile, have traded near three-year lows since late May.

Those sharp price declines prompted analysts at Simmons & Co., energy specialists at U.S. investment bank Piper Jaffray, to cut their U.S. oil and gas rig count forecasts for 2019 and 2020.

Simmons forecast the average combined oil and gas rig count will slide from a four-year high of 1,032 in 2018 to 992 in 2019 before rising to 1,011 in 2020 and 1,067 in 2021.

That compares with Simmons prior forecasts of 1,019 for 2019 and 1,097 for 2020.

Year-to-date, the total number of oil and gas rigs active in the United States has averaged 1,018. Most rigs produce both oil and gas.

The combination of numerous bullish and bearish factors affecting global oil prices in recent months “amounts to heightened levels of uncertainty that continue to slow the industry’s momentum and drilling activity,” Trey Cowan, senior analyst, S&P Global Platts Analytics, said in a note.

Despite recent declines in the rig count, U.S. oil output from seven major shale formations is expected to rise by about 70,000 barrels per day (bbl/d) in July to a record 8.5 million bbl/d, the U.S. Energy Information Administration said in its monthly drilling productivity report on June 17.

For the year, EIA projects total U.S. output will rise to 12.32 million bbl/d in 2019, up from a record of 10.96 million bbl/d in 2018.