Effect of the Casimir force on the entanglement between a levitated nanosphere and cavity modes