Phase diagram and structure of the charge-density-wave state in a high magnetic field in quasi-one-dimensional materials: A mean-field approach