Quantum theory of high-resolution length measurement with a Fabry-Perot interferometer