Determination of the strong coupling constant from the charmonium spectrum