Bring a large pot of salted water to a boil. Add the rice and bay leaves, reduce the heat to a simmer and cook as the label directs; drain well. Discard the bay leaves. Spread out the rice on a baking sheet to cool.
Meanwhile, preheat the oven to 375 degrees F and butter a shallow 3-quart baking dish. Heat the vegetable oil in a large skillet over medium-high heat. Add the squash, season with salt and pepper and cook, stirring, until softened and golden, 5 minutes. Transfer to a plate to cool.
Melt 4 tablespoons butter in the same skillet over medium-high heat. Add the leeks and celery and cook, stirring, until softened, 5 minutes. Add the broth, 1 teaspoon salt and a few grinds of pepper; bring to a simmer, then remove from the heat.
Whisk the egg in a large bowl. Stir in the rice, squash, leek-broth mixture, cranberries and parsley. Transfer to the baking dish; top with the pecans. Cut the remaining 2 tablespoons butter into small cubes; scatter over the pecans. Cover with foil and bake 30 minutes, then uncover and bake until golden, about 20 more minutes.Special equipment: