Prime minister vows to fight any challenge as senior ally warns of ‘fantasy politics’ within Labour Party