Optimizing the Communication-Accuracy Trade-off in Federated Learning with Rate-Distortion Theory