A delayed-choice experiment enabled by entanglement