Israel cuts deal with UN, scraps deportation plan