President Trump says the US will support a two-state solution in the Israeli-Palestinian conflict if it is agreed to by both sides.