President Obama defended the National Security Agency's phone and Internet surveillance programs, which he says help prevent terrorist attacks.