Preheat the oven to 350 degrees F. Adjust the racks to the middle of the oven. Spray three 9-inch cake pans with nonstick spray and dust lightly with flour.
Using a stand mixer, cream the butter until fluffy. Add the granulated sugar and continue to cream well for 6 to 8 minutes.
Add the eggs, one at a time, beating well after each addition. Add the flour and milk alternately to the creamed mixture, beginning and ending with the flour. Add the extract and continue to beat until just mixed. Then fold in the pecans.
Divide the batter equally among the prepared pans. Level the batter in each pan by holding pan 3 or 4 inches above the counter and dropping it flat onto the counter.
Bake until golden brown, 30 to 35 minutes. Cool the cakes completely before frosting.
For the frosting
Add the confectioners' sugar to a bowl and whisk to make sure there are no lumps. Set aside.
In a large bowl, blend together the cream cheese and butter with an electric hand mixer. Gradually add the confectioners' sugar and beat until light and fluffy. Beat in the extract.
Stir in the pecans (or reserve them to sprinkle over the frosted cake). Fill and frost the cake when the layers are completely cool.