Weak decays of the $B_c$ meson to charmonium and $D$ mesons in the relativistic quark model