Optimal monetary policy with heterogeneous money holdings