A determination of the charm content of the proton