French anti-terrorism prosecutors are investigating a knife attack at a church in the Mediterranean city of Nice that killed two people and injured several.