We calculate the hydrodynamic flow field generated far from a cilium which is attached to a surface and beats periodically. In the case of two beating cilia, hydrodynamic interactions can lead to synchronization of the cilia, which are nonlinear oscillators. We present a state diagram where synchronized states occur as a function of the distance of cilia and the relative orientation of their beat. Synchronized states occur with different relative phases. In addition, asynchronous solutions exist. Our work could be relevant for the synchronized motion of cilia generating hydrodynamic flows on the surface of cells.