U.S. stocks fell and oil prices jumped, as concerns about rising energy prices, supply shortages and inflation rattled investors once again.

The S&P 500 ticked down 0.6% Wednesday, while the Dow Jones Industrial Average fell 0.9%. The tech-focused Nasdaq Composite Index moved between small gains and losses and was recently down 0.2%. Major U.S. stock indexes jumped Tuesday, as investors shrugged off worries that inflation will push the nation’s economy into a recession.

On Wednesday, however, some of that confidence faded after Brent crude, the international benchmark, moved higher again. Futures on Brent crude recently traded at $120.85 a barrel, up 4.7%. In trading before the opening bell, futures for U.S. stock indexes wavered and then ticked lower, with losses deepening as oil prices jumped. 

Oil prices rose after Russia said on Tuesday that oil exports via a pipeline from Kazakhstan to the Black Sea may temporarily fall by around 1 million barrels a day—representing about 1% of global oil demand—citing storm damage. Repairs could take up to two months, Russian officials said.

“Things will stay highly sensitive to the events unfolding in Ukraine,” said Susannah Streeter, senior investment and markets analyst at Hargreaves Lansdown, noting that sharp moves in energy prices will continue to weigh heavily on indexes. “There is still real pressure on oil prices that is adding to inflationary concerns.”

Commodities were snapping higher across the board on a range of issues that threatened to pinch supply chains. Aluminum, nickel and steel prices rose on concerns ranging from the war in Ukraine to Covid-19 lockdowns in China. Tangshan, the biggest steelmaking city in China, told residents to stay home due to a Covid-19 surge, according to Reuters. The city accounts for 58% of China’s strip-steel output, London commodity broker SP Angel said in a Wednesday note.

“Inflation is still the 800-pound gorilla,” said Doug Sandler, global head of strategy at RiverFront Investment Group. The concern is that rising prices will force the Federal Reserve to raise rates faster than investors had previously expected, he said.

Mr. Sandler said his firm started pairing back its stockholdings earlier this year amid concerns about a riskier, more uncertain environment for the U.S. and global economies. The hope, he said, is that supply-chain issues that have pushed up the price of everything from corn to copper will work themselves out in the coming months, reducing the need for sharply higher fed-funds rates.

A sharp rally in U.S. government bond yields slowed. The yield on the 10-year U.S. Treasury note edged lower to 2.357% in recent trading, from 2.375% the day before. Yields on U.S. government bonds zoomed higher this week after Fed Chairman Jerome Powell

said the central bank was prepared to raise interest rates in half-percentage-point steps if needed to tame inflation. Yields climb when bond prices fall.

Russia’s stock market is set for a partial reopening Thursday, almost a month after it closed trading following the country’s invasion of Ukraine. Investors and analysts expect that the reopening could send Russian stocks into free fall.

In recent days, global markets seemed to have turned a corner, despite anxieties about mounting inflation and the war in Ukraine. The S&P 500 on Tuesday rose above its 200-day moving average after falling below it on Feb. 17. The benchmark index has advanced 1% or more in five of the last six sessions, bringing it up 8.1% over that period and erasing all of the losses seen since Russia invaded Ukraine.

Major indexes in Europe and Asia have seen similar moves. 

The recent rally has come even as Russia’s attacks on Ukraine intensify, Western countries continue to pile on sanctions and pricing pressures show no signs of abating. On Wednesday, fresh data on inflation showed that consumer prices in the U.K. rose 6.2% in February compared with a year earlier, up from 5.5% in January, marking the highest rate since March 1992. 

Fari Hamzei, of Hamzei Analytics, said the recent bounce in stocks has come on low volume, indicating it could be a so-called bear-market rally. He is looking for a few days of large drops in which 90% of New York Stock Exchange stocks decline, which would signal a buying opportunity.

“We haven’t seen capitulation,” he said. “You need volume to confirm the price action.”

Sharply higher oil prices could trigger such a decline. Mr. Hamzei expects WTI crude oil, which changed hands at about $114 a barrel Wednesday, to surge to between $135 or $145 a barrel. A significant escalation of the conflict in Ukraine, he said, could also push investors out of stocks.

In European markets, the Stoxx Europe 600 lost 1.1%, erasing earlier gains once oil prices moved solidly higher. London’s FTSE 100 nudged down 0.1%. European oil giants Shell and BP each rose 3.3% or more.

In midday trading in New York, shares of energy companies also moved higher. Occidental Petroleum, Exxon Mobil

and Chevron each gained about 1% to 2%.

Higher oil prices could spark more consumer interest in electric vehicles, analysts said. Shares of Tesla were up about 3% in early afternoon trading. The stock has risen each of the last seven trading days, its longest winning streak since August 2021, putting the EV maker up more than 30% in that time period.

Meanwhile, shares of meme stocks—which have largely slumped this year—enjoyed a resurgence. Shares of GameStop climbed 11% after the company’s chairman, Ryan Cohen, disclosed his firm bought 100,000 shares of the company’s stock on Tuesday. Shares of AMC Entertainment Holdings, which tend to move in correlation with GameStop, climbed 4.9%.

Shares of Adobe slumped 8.1%. The software company reported higher profit and better-than-expected revenue growth Tuesday, but said it expects a hit to annual revenue from the war in Ukraine.

Traders worked on the floor of the New York Stock Exchange on Tuesday.

Photo: BRENDAN MCDERMID/REUTERS

In European bond markets, the yield on the benchmark 10-year German bund traded around 0.497% after topping 0.5% this week. The last time it traded around that level was the fall of 2018.

Other signs emerged Wednesday that investors were eyeing assets they perceive as safer. The ICE U.S. Dollar index, which tracks the currency against a basket of others, rose 0.2% in recent trading. Gold prices advanced 0.4%. 

In Asia, major indexes finished higher. Hong Kong’s Hang Seng gained 1.2%, while Japan’s Nikkei 225 jumped 3%. China’s Shanghai Composite advanced 0.3%.

—Georgi Kantchev contributed to this article.

Write to Caitlin McCabe at caitlin.mccabe@wsj.com and Scott Patterson at scott.patterson@wsj.com