Preheat oven to 350°.
In a medium bowl, combine 2 cups flour and confectioners’ sugar. Using a pastry blender, cut in butter until mixture is crumbly; stir in cashews. Press mixture into bottom of a 13x9-inch baking pan. Bake for 15 minutes.
In a medium bowl, beat cream cheese and ½ cup granulated sugar with a mixer at medium speed until smooth. Add milk and lemon extract, beating until well combined; pour over crust. Bake for 15 minutes. Let cool for 10 minutes.
In a medium bowl, whisk together eggs, lemon zest and juice, and remaining 1¾ cups sugar.
In a small bowl, whisk together baking powder and remaining ¼ cup flour; add to sugar mixture, whisking to combine. Pour over cream cheese mixture.
Bake until a wooden pick inserted in center comes out slightly sticky, about 40 minutes. Cut into squares. Garnish with confectioners’ sugar, raspberries, and zest, if desired.