First-principles structural optimization and electronic structure of the superconductor picene for various potassium doping levels