Energy loss of charm quarks in the quark-gluon plasma: Collisional vs radiative losses