The U-2 is a high-altitude aircraft used for reconnaissance and surveillance .