US president cuts short first visit to Spain