The prime minister has expressed frustration that energy prices at home are rising due to wars in Ukraine and Iran, and staunchly defended the NATO alliance after criticism from Donald Trump.