Yes, but with some very strict limitations.
You can store encrypted data in the block chain. This is expensive, hard, and strongly discouraged, but it is possible to place the encrypted data in nulldata (OP_RETURN) transactions. Each standard OP_RETURN output is limited to an 80 byte payload, so you'll probably need to use multiple outputs which will require multiple transactions unless you have the help of a miner.
A later transaction can publicly disclose the key to the encrypted data. You can use a smart contract (specifically a hashlock) to pay someone to release the key. A clever use of cryptography may be able to restrict them from releasing the keys except under certain circumstances; for example Peter Todd's timelocks can restrict the public release of the key by number of CPU hours spent generating the decryption key.
The essential piece of information here is that you can't make the key release mechanism part of a smart contract because the key would need to be public. At best you can only use a smart contract to incentivize someone who already has a key (or the ability to regenerate a key) to publicly release that key when the incentives are worth it.
With that said, it's probably much better in most cases to put your encrypted data in a torrent file rather than the block chain, and at most use a Bitcoin hashlock to incentivize anyone with the decryption key to release it. (It'd be nice if you also made the hashlock an anyone-can-spend after an expiration time so that it wouldn't bloat the UTXO set forever if the decryption key was permanently lost.)