Tech stocks help lift S&P 500, Nasdaq