BEIJING—A steep drop-off in China's crude-oil imports from Iran earlier this year, which companies involved blamed on a contract dispute, has provided a face-saving way for Beijing to appease the U.S. even as it officially maintains opposition to U.S. sanctions against Tehran, analysts said.