The effective action in Einstein-Maxwell theory