The widespread deployment of white light-emittingdiodes (LEDs) for illumination provides a unique opportunity to create a flexible, accurate, and ubiquitous indoor communication and positioning system. Recent studies have shown that determining the position of a person or an object in a room can use the signals transmitted by LEDs. In this paper, we exploit the location information obtained via LEDs to improve the communication performance of an indoor visible light communication (VLC) system. Specifically, we propose an optimal LED power management framework to maximize the average data rate across the room while satisfying the bit error rate (BER) and illumination constraint across the room. The maximum allowed localization error, as a function of the number of blockages and the LED irradiance angle, have been calculated. In addition, the closed-form expression for the BER is derived for the proposed optimal LED power allocation scheme. We have also formulated an optimization problem that will maximize the power savings among the LEDs with respect to the number of blockages and permissible error in localization. It has been shown that, by employing the proposed optimal LED power allocation will results in a significant amount of power-saving, which is approximately 40% for 4 LEDs configuration and 70% for 8 LEDs configuration as compared to equal power allocation. Further, the maximum allowed localization error is found out to be approximately 7 cm and 18 cm with 4 and 8 LEDs, respectively, to achieve the maximum achievable data rate. Finally, it is shown that the dimming range of up to 70% can be achieved for the proposed system.