This work addresses the problem of coupling vision-based navigation systems for Unmanned Aerial Vehicles (UAVs) with robust obstacle avoidance capabilities. The former is formulated by a maximization of the point of interest visibility, while the latter is modeled by ellipsoidal repulsive areas. The whole problem is transcribed into an Optimal Control Problem (OCP), and solved in a few milliseconds by leveraging state-of-the-art numerical optimization. The resulting trajectories are then well suited to achieve the specified goal location while avoiding obstacles by a safety margin and minimizing the probability to loose track with the target of interest. Combining this technique with a proper ellipsoid shaping (e.g. augmenting the shape with the obstacle velocity, or the obstacle detection uncertainties) results in a robust obstacle avoidance behaviour. We validate our approach within extensive simulated experiments demonstrating (i) capability to satisfy all the constraints, and (ii) the avoidance reactivity even in challenging situations. We release with this paper the open source implementation