US stocks end mixed as energy sector rides surge in oil prices while tech stocks fall