Forward and midrapidity charmonium production at RHIC