Narrowband Internet-of-Things (NB-IoT) offers a significant link budget improvement in comparison with the legacy networks by introducing different coverage classes, allowing repeated transmissions, and tuning the repetition order based on the path-loss in communications. However, those repetitions necessarily increase energy consumption and latency in the whole NB-IoT system. The extent to which the whole system is affected depends on the scheduling of the uplink and downlink channels. We address this question, not treated previously, by developing a tractable model of NB-IoT connectivity, comprising message exchanges in random-access, control, and data channels. The model is then used to analyze the impact of channel scheduling and interaction of coverage classes on the performance of IoT devices through the derivation of the expected latency and battery lifetime. These results are subsequently employed in determining the optimized operation points, i.e., (i) scheduling of data and control channels for a given set of users and respective coverage classes, or (ii) determining the optimal set of coverage classes and served users per coverage class for a given scheduling strategy. Simulations results show the validity of the analysis and confirm that channel scheduling and coexistence of coverage classes significantly affect latency and battery lifetime performance of NB-IoT devices.