US stock market closes higher with gains in tech stocks