Optical model plus resonance analysis of the elastic scattering of protons by C12