Backscatter communication is a promising solution for enabling information transmission between ultra-low-power devices, but its potential is not fully understood. One major problem is dealing with the interference between the backscatter devices, which is usually not taken into account, or simply treated as noise in the cases where there are a limited number of backscatter devices in the network. In order to better understand this problem in the context of massive IoT (Internet of Things), we consider a network with a base station having one antenna, serving one primary user, and multiple IoT devices, called secondary users. We formulate an optimization problem with the goal of minimizing the needed transmit power for the base station, while the ratio of backscattered signal, called backscatter coefficient, is optimized for each of the IoT devices. Such an optimization problem is non-convex and thus finding an optimal solution in real-time is challenging. In this paper, we prove necessary and sufficient conditions for the existence of an optimal solution, and show that it is unique. Furthermore, we develop an efficient solution algorithm, only requiring solving a linear system of equations with as many unknowns as the number of secondary users. The simulation results show a lower energy outage probability by up to 40-80 percentage points in dense networks with up to 150 secondary users. To our knowledge, this is the first work that studies backscatter communication in the context of massive IoT, also taking into account the interference between devices.