Spain has agreed to cooperate with US military, says White House