It seems that there is some underlying issue due to the fact that the Mollweide projection has singularities for latitudes of +/- 90°. A solution suggested by @pelson on github is to use Basemap:
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
ra = np.linspace(-np.pi, np.pi, 40)
dec= np.linspace(-np.pi/2, np.pi/2, 20)
X,Y = np.meshgrid(ra,dec)
Z = np.sin(X) * np.cos(X) * np.sin(Y) * np.cos(Y)
RAD = 180/np.pi
m = Basemap(projection='moll',lon_0=0,resolution='c')
m.contour(X*RAD, Y*RAD, Z, 10, colors='k',latlon=True)
m.contourf(X*RAD, Y*RAD, Z, 100, cmap=plt.cm.jet,latlon=True)
plt.show()
This code works as proven below: