A quick Google suggests that exclusive breastfeeding on cue has a 98% effectiveness (typical use) at preventing pregnancy. The pill has only a 92% chance (again, typical use; if used correctly 100% of the time it is near-perfect).
Partial breastfeeding (supplemented with formula) is much less effective, though!