Atomic clocks as detectors of gravitational waves