US stocks close higher as tech rally offsets Iran war concerns