The research that dtheriault posted was done at my school, UMBC, by my professor, Dr. Provine. He also says that yawning is contagious because helps to synch us as a society. Yawning helps us change states. When people go from resting to alertness, we often yawn. We also yawn when we are changing from an alert state to a restful one. In societies, the contagiousness of yawning helps everyone stay in approximately the same state and increase effectiveness of the whole. More info
here.