US stocks erase sharp losses, while oil prices leap on worries about Iran war