Palestinian factions 'agree deal'