Major indexes had opened higher on hopes for a U.S.-Iran deal, then reversed as tech stocks wiped out earlier gains