Detecting nonlocality in many-body quantum states