Diffractive production of charm and jets at HERA