The attack reflects Washington’s determination to safeguard the flow of oil through the Persian Gulf.