European officials agree on loan terms for Greece