Oil prices rose and stocks rallied worldwide on Thursday after China said it had agreed with the United States to cancel tariffs in phases, a key consideration in reaching a deal to end a trade war that has crimped economic growth and roiled markets.