U.S. markets closed higher on Friday after Trump signaled flexibility on tariffs and trade talks with China. Stocks in Asia and Europe also rose.