Spectra of the lightest baryons containing two heavy quarks in a potential model