Charge transfer upon contact between metals and insulators