A blank-check company backed by hedge fund Magnetar Capital has agreed to merge with intelligent energy storage business Stem Inc. to form a single company with an enterprise value of $1.35 billion, the companies said Friday, in a deal built by Kirkland & Ellis, Gibson Dunn and Wilson Sonsini.