Modulational instability and spatiotemporal transition to chaos