Rate-optimal nonparametric estimation for random coefficient regression models