U.S. stocks traded in a narrow range Wednesday morning, suggesting that the major indexes are likely to close near record highs for the end of the quarter following a June rally powered by technology stocks.

The S&P 500 rose less than 0.1%, led by energy and industrial services after the broad-market index closed Tuesday at its 33rd all-time high of 2021. The gauge has climbed 2.1% so far in June in its fifth consecutive month of gains. The Dow Jones Industrial Average wobbled between gains and losses, recently adding 54 points, or about 0.2%. The blue-chips index is on pace to end June lower, marking its weakest month since January.

The Nasdaq composite declined 0.2%, about 23 points, pointing to tepid moves in technology stocks a day after the index notched a record high. The benchmark for technology stocks has climbed 5.5% so far in June.

Recently, investors have been rotating back into the technology stocks that they favored during Covid-19 lockdowns after inflation fears eased and low bond yields spurred a hunt for better returns. Optimism about the economic recovery, the prospect of more fiscal stimulus and confidence that the Federal Reserve will continue to support credit markets has also boosted sentiment in recent days.

“Growth sectors have been performing better as bond yields have stabilized,” said Shaniel Ramjee, a multiasset fund manager at Pictet Asset Management. “Given that it is the larger-cap part of the market, we’ll see overall indexes trending higher.”

The nonfarm private sector in the U.S. added 692,000 jobs in June, a drop from the previous month, but still above economists’ estimates, according to the latest ADP National Employment Report. Investors are closely scrutinizing any new information on the strength of the labor market, which the Fed has indicated is a priority.

In bond markets, the yield on the benchmark 10-year Treasury note edged down to 1.456% from 1.479% on Tuesday. As of Tuesday, the yield had dropped 0.113 percentage points this month. Bond yields fall when prices rise.

Brent crude, the international benchmark for oil prices, rose 0.5% to about $74.66 a barrel ahead of a meeting this week of major oil producers to discuss a potential increase in supply. The gauge is on course to post its biggest first-half gain since 2009, having risen nearly 44.2% so far in 2021.

Overseas, the pan-continental Stoxx Europe 600 slid 0.5% The index’s travel and leisure subsector is down 5.5% for the week so far, reflecting concern about the rise of Covid-19’s Delta variant in European countries such as the U.K. and Portugal.

“When you have initial spikes, especially in Europe, we are seeing the market take notice,” Mr. Ramjee said. “This doesn’t mean that we are expecting lockdowns, but could we expect a little bit of nervousness? Yes, that is possible.”

Stock benchmarks in southern European countries that are reliant on tourism were among the worst performers in the region, with Spain’s IBEX index dropping 0.8% and Portugal’s PSI index falling 1.2%.

In Asia, major benchmarks ended the final day of trading in June on a mixed note. The Shanghai Composite Index advanced 0.5% Wednesday, while Hong Kong’s Hang Seng Index slipped 0.6% by the close of trading.

The Nasdaq Composite and S&P 500 ended Tuesday at records.

The Nasdaq Composite and S&P 500 ended Tuesday at records.

Photo: Richard Drew/Associated Press

Write to Anna Hirtenstein at anna.hirtenstein@wsj.com