Narrowband Internet of Things (NB-IoT) is a cellular IoT communication technology standardized by 3rd Generation Partnership Project for supporting massive machine type communication and its deployment can be realized by a simple firmware upgrade on existing LTE networks. The NB-IoT requirements in terms of energy efficiency, achievable rates, latency, extended coverage, make the resource allocation, in a limited bandwidth, even a more challenging problem w.r.t. to legacy LTE. The allocation, done with sub-carrier granularity in NB-IoT, should maintain adequate performance for the devices while keeping the power consumption as low as possible. Nevertheless, the optimal solution of the resource allocation problem is typically unfeasible since non-convex, NP-hard and combinatorial because of the use of binary variables. In this paper, after the formulation of the optimization problem, we study the resource allocation approach for NB-IoT networks aiming to analyze the trade-off between rate and latency. The proposed sub-optimal algorithm allocates radio resource (i.e. subcarriers) and transmission power to the NB-IoT devices for the uplink transmission and the performance is compared in terms of latency, rate, and power. By comparing the proposed allocation to a conventional Round Robin (RR) and to a brute-force approach, we can observe the advantages of the formulated allocation problem and the limited loss of the sub-optimal solution. The proposed algorithm outperforms the RR by a factor 2 in terms of spectral efficiency and, moreover, the study includes techniques that reduce the dropped packets from 29% to 1.6%.