The United States is warning Americans against visiting Cuba and ordering more than half of US personnel to leave the island, senior officials say, in a dramatic response to what they described as “specific attacks” on diplomats.