Unmanned aerial vehicles (UAVs) can be used as aerial relays to provide quick and on-demand wireless connections for the area without network coverage. Since a UAV’s onboard energy is limited, how to prolong the duration of UAV relaying communication is challenging. In this paper, we consider applying multiple UAVs to extend the duration of communication via UAV collaboration. We first propose a UAV collaboration scheme, namely heuristic UAV substitution, which lets the UAV relays work one by one individually. Then, we propose another scheme called spectral efficient UAV substitution to improve the spectrum efficiency. Furthermore, under these two proposed schemes, we jointly design the trajectories of the UAV relays and the transmit power of the source and the UAV relays, with the goal of end-to-end throughput maximization. Although the considered optimization problem is non-convex and difficult to solve, we propose an efficient algorithm to find a suboptimal solution to it by applying the block coordinate ascent and successive convex approximation methods. Simulation results show that the proposed UAV substitution schemes can effectively extend the relaying communication duration, and the throughput performance of the proposed joint trajectory optimization and transmit power control algorithm outperforms some benchmark algorithms without considering joint design.