Saudi Arabia and Iran are restoring full diplomatic relations in a deal brokered by China, a move that could reduce tensions in the region and that asserts China’s growing influence in the Gulf.