Determination of the quark and gluon moments of the nucleon