The attack came on the same day that President Xi Jinping ended a visit to the restive region in China’s far west that is home to the country’s mostly Muslim Uighur minority.