In the bowl of an electric mixer fitted with the paddle attachment, beat together butter and confectioners' sugar on medium speed until light and fluffy, about 3 minutes. Add vanilla and egg, and beat to combine. Gradually add flour, and beat until well incorporated. Transfer dough to a pastry bag fitted with a 7/16-inch star tip (such as Ateco #825).