A study of charm production in beauty decays with the OPAL detector at LEP