Wireless body area network (WBAN) is an emerging short-range wireless communication network with sensor nodes located on, in or around the human body for healthcare, entertainment and ubiquitous computing. In WBANs, energy is severely constrained which is the prime consideration in the medium access control (MAC) protocol design. In this paper, we propose a novel MAC protocol named Energy-efficient Relay MAC with dynamic Power Control (ERPC-MAC) to save energy consumption. Without relying on the additional devices, ERPC-MAC employs relaying nodes to provide relay service for nodes which consume energy fast. Accordingly the superframe adjustment is performed and then the network topology can be smoothly switched from single-hop to multi-hop. Moreover, for further energy saving and reliability improvement, the dynamic power control is introduced to adjust the power level whenever a node transmits its packets to the coordinator or the relaying node. To the best of the authors' knowledge, this is the first effort to integrate relay, topology adjustment and power control to improve the network performance in a WBAN. Comprehensive simulations are conducted to evaluate the performance. The results show that the ERPC-MAC is more superior to the existing standard and significantly prolongs the network lifetime.