Preheat oven to 350°F with rack in middle. Generously butter a 9- by 2-inch round cake pan and line bottom with a round of parchment paper.
Toast coconut in a small baking pan in oven, stirring once or twice, until golden, 8 to 12 minutes. Cool. Leave oven on.
Beat together butter, granulated sugar, and zest with an electric mixer until fluffy. Beat in eggs 1 at a time. Stir together flour and 1/2 cup coconut (reserve remainder for topping). Stir together milk and 2 Tbsp lime juice. At low speed, mix flour and milk mixtures into egg mixture alternately in batches, beginning and ending with flour.
Spoon batter into pan and smooth top. Bake until golden and a wooden pick inserted into center comes out clean, 40 to 45 minutes. Cool to warm, then turn out of pan and discard parchment.
Whisk together confectioners sugar, remaining 2 Tbsp lime juice, and rum (if using) and pour over cake. Sprinkle with remaining coconut.