The United Nations has endorsed a resolution reviving a two-state solution between Israel and Palestine.