Error analysis of a finite element approximation of a degenerate Cahn-Hilliard equation