In this paper, we study a cellular-enabled unmanned aerial vehicle (UAV) communication system consisting of one UAV and multiple ground base stations (GBSs). The UAV has a mission of flying from an initial location to a final location, during which it needs to maintain reliable wireless connection with the cellular network by associating with one of the GBSs at each time instant. We aim to minimize the UAV mission completion time by optimizing its trajectory, subject to a quality of connectivity constraint of the GBS-UAV link specified by a minimum received signal-to-noise ratio (SNR) target, which needs to be satisfied throughout the mission. This problem is non-convex and difficult to be optimally solved. We first propose an effective approach to check its feasibility based on graph connectivity verification. Then, by examining the GBS-UAV association sequence during the UAV mission, we obtain useful insights on the optimal UAV trajectory, based on which an efficient algorithm is proposed to find an approximate solution to the trajectory optimization problem by leveraging techniques in convex optimization and graph theory. Numerical results show that our proposed trajectory design achieves near-optimal performance.