Constraining nonlocal gravity by S2 star orbits