The explosive growth in Internet of Things (IoT) in terms of number of applications and deployed devices has created many challenges over the past decade. Among the most critical of which are the increasing demand on spectrum resources, the growing computation and data processing cost, and the limited energy resources. In this paper, we present a model for IoT networks that incorporates the technologies of cognitive radio (CR), mobile edge computing (MEC), unmanned aerial vehicles (UAVs), and radio-frequency energy harvesting to address the aforementioned challenges. In this model, UAVs provide computation and energy recharging services to IoT devices. These services can be requested/delivered through multiple spectrum bands by exploiting the CR technology. Specifically, aim at scheduling the task offloading and energy transmission/harvesting activities over time and frequency so that the maximum energy consumption rate among IoT devices is minimized. A mixed integer linear program was formulated to find such schedule. A greedy sub-optimal algorithm was also proposed, where our results show that it is within approximate to 11% of the optimal solution. We also investigate the maximum energy consumption rate among IoT devices under several settings regarding number of UAV MEC servers, task size, task offloading cost, and task local computation cost.