Generalized Einstein-Maxwell theory: Seeley-DeWitt coefficients and logarithmic corrections to the entropy of extremal and nonextremal black holes