The advent of fifth generation (5G) networks has opened new avenues for enhancing connectivity, particularly in challenging environments like remote areas or disaster-struck regions. Unmanned aerial vehicles (UAVs) have been identified as a versatile tool in this context, particularly for improving network performance through the Integrated access and backhaul (IAB) feature of 5G. However, existing approaches to UAV-assisted network enhancement face limitations in dynamically adapting to varying user locations and network demands. This paper introduces a novel approach leveraging deep reinforcement learning (DRL) to optimize UAV placement in real-time, dynamically adjusting to changing network conditions and user requirements. Our method focuses on the intricate balance between fronthaul and backhaul links, a critical aspect often overlooked in current solutions. The unique contribution of this work lies in its ability to autonomously position UAVs in a way that not only ensures robust connectivity to ground users but also maintains seamless integration with central network infrastructure. Through various simulated scenarios, we demonstrate how our approach effectively addresses these challenges, enhancing coverage and network performance in critical areas. This research fills a significant gap in UAV-assisted 5G networks, providing a scalable and adaptive solution for future mobile networks.