A surprise strike by Iran has rattled global markets and sent oil prices higher.