The US president has previously criticised Nato members for not meeting spending targets.