Catalyzes the chiral reduction of acetoacetyl-CoA to (R)-3-hydroxybutyryl-CoA. Is involved in the biosynthesis of polyhydroxybutyrate (PHB), which is accumulated as an intracellular energy reserve material when cells grow under conditions of nutrient limitation