European leaders have backed plans to spend more on defence and continue to stand by Ukraine in a world up-ended by President Donald Trump's reversal of US policies.