BEIJING — China’s leader, Xi Jinping, and President Trump spoke by phone on Wednesday about the escalating tensions with North Korea as a prominent Chinese state-run newspaper warned the North that it faced a cutoff of vital oil supplies if it dared test a nuclear weapon.

The phone call, reported by China’s state broadcaster, CCTV, came hours after Mr. Trump cautioned Beijing in a Twitter message and a television interview that it needed to help Washington rein in North Korea, a Chinese ally. During the call, which was initiated by Mr. Trump, Mr. Xi said that the matter should be solved through peaceful means, the state news agency Xinhua reported.

Tensions escalated further on Wednesday as reports said the Japanese Navy would join the United States Navy strike group led by the aircraft carrier Carl Vinson in its mission off the Korean coast. Those joint exercises will take place as the American ships pass through waters close to Japan, Reuters said.

The Carl Vinson and several other warships are heading toward the Korean Peninsula in a show of force intended to deter the North from testing a sixth nuclear weapon or launching missiles.