Palestinian factions, including rivals Hamas and Fatah, will hold unity talks in China in July as they try to resolve deep divisions.