Renormalization of general relativity on a background of spacetime foam