Quantum entanglement of masses with nonlocal gravitational interaction