While butter contributes to the flavor and texture of the cake, you can substitute margarine. However, the taste and texture of the cake may differ slightly.