The US and China have signed "phase one" of a trade deal in which both countries have made concessions to bring an end to a long-running trade war.