Let cool completely in the pan on a wire rack, then cover and refrigerate until fully set, about 2 hours. Loosen the sides with a knife if necessary and lift the bars from the pan using the overhanging foil. Gently turn and peel the foil off the crust (it might stick a little), then turn right-side up and transfer to a cutting board. Cut the bars with a large knife into 2-in squares, wiping the knife clean with a damp paper towel between cuts. Dust with powdered sugar if desired. Store, covered, in the refrigerator for up to 2 days.