Heat the oven to 350°F. Butter a 13-by-9-inch inch baking pan.
In a medium bowl, whisk the melted butter, milk, sugar, eggs, and vanilla.
In a large bowl, whisk the flour and baking powder. Add the milk mixture to the flour mixture in 5 to 7 increments, stirring well after each addition to prevent lumps from forming. Pour the batter into the prepared pan.
Drop the red bean paste by scant teaspoonfuls onto the top of the cake, if using. If the spoonfuls are too big, the filling will sink to the bottom.
Bake for about 1 hour and 10 minutes, until the cake springs back when lightly touched. It should be golden and crusty. Let cool completely before serving.
For extra decadence, you can slice the niangao into thin slices, dip them in beaten egg, and pan-fry for Cantonese-style niangao.
