Europe is more vulnerable to an al-Qaeda attack because of its proximity to the group's operating regions, Barack Obama has said.