The internal mechanism of cilia is among the most ancient biological motors on an evolutionary scale. It produces beat patterns that consist of two phases: during the effective stroke, the cilium moves approximately as a straight rod, and during the recovery stroke, it rolls close to the surface in a tangential motion. It is commonly agreed that these two phases are designed for efficient functioning: the effective stroke encounters strong viscous resistance and generates thrust, whereas the recovery stroke returns the cilium to starting position while avoiding viscous resistance. Metachronal coordination between cilia, which occurs when many of them beat close to each other, is believed to be an autonomous result of the hydrodynamical interactions in the system. Qualitatively, metachronism is perceived as a way for reducing the energy expenditure required for beating. This paper presents a quantitative study of the energy expenditure of beating cilia, and of the energetic significance of metachronism. We develop a method for computing the work done by model cilia that beat in a viscous fluid. We demonstrate that for a single cilium, beating in water, the mechanical work done during the effective stroke is approximately five times the amount of work done during the recovery stroke. Investigation of multicilia configurations shows that having neighboring cilia beat metachronally is energetically advantageous and perhaps even crucial for multiciliary functioning. Finally, the model is used to approximate the number of dynein arm attachments that are likely to occur during the effective and recovery strokes of a beat cycle, predicting that almost all of the available dynein arms should participate in generating the motion.