Data at the Foreign Office has been hacked, but the government has said it is "pretty confident" that visa applicants' details have not been compromised.