Cholesteric-nematic transition induced by a magnetic fieldin the strong-anchoring model