Stocks close higher, lifted by Microsoft, Meta earnings