Variational approach to excitons in carbon nanotubes